// 引入商品分类列表接口
import {
    catelist
} from '../../../request/api'
const state = {
    cateList: []
}

const getters = {
    getcate(state) {
        return state.cateList
    }
}

const mutations = {
    setCateList(state, plydata) {
        state.cateList = plydata
    }
}

const actions = {
    getCateList({commit}) {
        catelist().then(res => {
            console.log(res,'一级分类')
            commit('setCateList',res.list)
            
        })
    }
}

export default {
    state,
    mutations,
    actions,
    getters,
    namespaced:true
}